package com.example.administrator.yunniuusedcar.adapter;

import android.content.Context;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.administrator.yunniuusedcar.R;
import com.example.administrator.yunniuusedcar.adapter.baseadapter.BaseAdapter;
import com.example.administrator.yunniuusedcar.adapter.baseadapter.BaseViewHolder;
import com.example.administrator.yunniuusedcar.adapter.baseadapter.SimpleAdapter;
import com.example.administrator.yunniuusedcar.bean.SelectCarData;
import com.squareup.picasso.Picasso;

/**
 * Created by Administrator on 2018/1/2 0002.
 */

public class SelectCarAdapter<D> extends SimpleAdapter<SelectCarData>{
    private Context context;
    public SelectCarAdapter(Context context) {
        super(context,  R.layout.fragment_zonghepaixu);
        this.context = context;
    }

    @Override
    protected void convert(BaseViewHolder viewHoder, SelectCarData item) {
        ImageView ivHomeCarPage = viewHoder.getImageView(R.id.iv_home_carPage);
        TextView tvHomeCatInfo = viewHoder.getTextView(R.id.tv_home_catInfo);
        TextView tvZGCarYhMoney = viewHoder.getTextView(R.id.tv_ZG_carYhMoney);
        TextView tvHomeCarPay = viewHoder.getTextView(R.id.tv_home_carPay);
        TextView itemHomeCarSCsave = viewHoder.getTextView(R.id.item_home_carSCsave);
        TextView tvHomeCarMoney = viewHoder.getTextView(R.id.tv_home_carMoney);


        Picasso.with(context).load(item.getLogo()).into(ivHomeCarPage);
        tvHomeCatInfo.setText(item.getName());
        tvZGCarYhMoney.setText(item.getIntegral_range());
        tvHomeCarMoney.setText(item.getMarket_price());

    }
}
